Description

Selects an input tank from among several tanks based on a selection rule. To use this function, you must list all tanks included in the selection together in the Location module.

Components

<First Tank>

The name or location index number of the starting tank in the range.

<Number of Tanks>

The number of tanks in the selection range (limit 10).

<Selection Rule>

The rule for making the selection may be one of the following:

Tank_InOrder (selects the first blocked tank encountered)

Tank_LongestBlocked (selects the tank blocked the longest)

<Minimum Level>

The minimum level of the input tank before considering it for selection. If the tank must be full before considering it for an input source, enter 0.

<Product Type>

An integer specifying the required value for the Product array in order to select the tank. Enter 0 if the tank selection requires no product type match.

Example

A tanker arrives at a pick up station to load from one of 5 tanks depending on which tank has been full the longest. The tanker will fill from a partial tank if the tank has any contents at all (at least .1 gallons). To model the tank selection, define the following operation logic for Tanker at PickUpStation:

INT SelectedTank

Selected_Tank=Tank_SelectInput(Tank1, 5, Tank_LongestBlocked, .1, 0)